package com.jn.erp.web.api.interaction.controller;


import com.jn.erp.common.core.result.AjaxResult;
import com.jn.erp.security.controller.BaseWebAuthController;
import com.jn.erp.web.api.interaction.service.TEvaluateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@RestController
@RequestMapping("/obsStorage")
public class obsController  extends BaseWebAuthController {

    @Autowired
    private TEvaluateService tEvaluateService;


    /**
     * 上传文件
     * @param file
     * @return
     */
    @PostMapping("upload")
    public AjaxResult upload(List<MultipartFile> file){
        List<String> url = tEvaluateService.upload(file);
        return AjaxResult.success(url);
    }

    /**
     * 删除上传文件
     */

    @PostMapping("delete")
    public AjaxResult delete(@RequestBody List<String> url){
      tEvaluateService.delete(url);
        return AjaxResult.success("删除成功");
    }



}
